package com.dwm716.shorturl.service;

import com.dwm716.shorturl.common.ApiResponse;
import com.dwm716.shorturl.domain.UrlMap;
import com.dwm716.shorturl.dto.CreateShortUrlVo;
import com.dwm716.shorturl.dto.ShortUrlQuery;
import com.dwm716.shorturl.pagehelper.PageResult;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.web.servlet.view.RedirectView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author biliyu
 * @date 2023/6/6 10:47
 */
public interface ShortUrlService {
    ApiResponse<UrlMap> createShortUrl(CreateShortUrlVo createShortUrlVo);

    RedirectView redirect(HttpServletRequest request, String key);

    ApiResponse<PageResult<UrlMap>> getShortUrlList(ShortUrlQuery query);

    ApiResponse<List<UrlMap>> batchCreateShortUrl(List<CreateShortUrlVo> createShortUrlVoList);

}
